
import socketserver模块

sk = socketserver模块.socket(type=socketserver模块.SOCK_DGRAM)
sk.bind(('127.0.0.1', 9000))

while True:
    msg, addr = sk.recvfrom(1024)
    print(msg.decode('utf-8'))
    msg = input('>>>').encode('utf-8')
    sk.sendto(msg, addr)
sk.close()
